#!/bin/bash

# Docker Compose配置文件验证脚本

echo "🔍 验证Docker Compose配置文件..."

# 验证开发环境配置
echo "检查 docker-compose.yml..."
if docker-compose -f docker-compose.yml config > /dev/null 2>&1; then
    echo "✅ docker-compose.yml 配置正确"
else
    echo "❌ docker-compose.yml 配置有误"
    docker-compose -f docker-compose.yml config
    exit 1
fi

# 验证生产环境配置
echo "检查 docker-compose.prod.yml..."
if docker-compose -f docker-compose.prod.yml config > /dev/null 2>&1; then
    echo "✅ docker-compose.prod.yml 配置正确"
else
    echo "❌ docker-compose.prod.yml 配置有误"
    docker-compose -f docker-compose.prod.yml config
    exit 1
fi

echo "🎉 所有配置文件验证通过！" 